//
//  MSStarEvaluator.h
//  Takeaway
//
//  Created by iOS on 2017/7/18.
//  Copyright © 2017年 MS. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol MSStarEvaluatorDelegate;
@protocol MSStarEvaluatorDataSource;
/**
 五星评价器
 */
@interface MSStarEvaluator : UIControl

/**
 隐式属性动画
 */
@property (nonatomic)   BOOL    animation;
@property (nonatomic)   BOOL    whole;      ///< 整星，默认NO，非整颗星
@property (nonatomic)   CGFloat leave;      ///< 0-5

@property (nonatomic, weak)     id<MSStarEvaluatorDataSource>   dataSource;
@property (nonatomic, weak)     id<MSStarEvaluatorDelegate>     delegate;

/**
 便利构造器

 @param initialValue 0-5
 */
+ (MSStarEvaluator *)starEvaluatorWithValue:(CGFloat)initialValue
                                 dataSource:(id<MSStarEvaluatorDataSource>)dataSource;

@end

@protocol MSStarEvaluatorDelegate <NSObject>

- (void)starEvaluator:(MSStarEvaluator *)view valueChanged:(CGFloat)currentValue;

@end

@protocol MSStarEvaluatorDataSource <NSObject>

/** 星星间距 */
- (CGFloat)spaceForStarInStarEvaluator:(MSStarEvaluator *)view;
/** 星星大小 */
- (CGSize)sizeForStarInStarEvaluator:(MSStarEvaluator *)view;
/** 满星图片 */
- (NSString *)fullImageForStarInStarEvaluator:(MSStarEvaluator *)view;
/** 空星图片 */
- (NSString *)emptyImageForStarInStarEvaluator:(MSStarEvaluator *)view;


@end
